作者:se8529106 | 来源:互联网 | 2023-05-20 17:21
我不明白为什么有两个属性似乎做同样的事情,但它们的相互关系似乎没有在规范中定义.
http://dev.w3.org/csswg/css-text-3/#word-break-property
http://dev.w3.org/csswg/css-text-3/#overflow-wrap-property
例如,如果我想按文件包装文本如何在预标记中包装文本?,有些行包含没有空格的字符串(这似乎使Chrome认为它们是不可破坏的(即使它们确实有逗号等)),我是否要使用word-break: break-all
或者word-wrap: break-word
除此之外white-space: pre-wrap
?
1> 小智..:
word-break:break-all its break the sentence and text in other line
word-wrap:break-word`它不会破坏句子它的断行和完整的句子转到下一行而不会中断
p {
width:100px;
word-break:break-all;
padding-left:20px;
}
div {
width:100px;
word-wrap: break-word;
padding-left:20px;
}
India's Saina Nehwal won the Australian Badminton Open Super Series title at the State Sports Centre in Sydney on 29 June, 2014. Saina began the match in aggressive fashion as she raced into a 12-8 lead in the first game against Spain's Carolina Marin in the final.
India's Saina Nehwal won the Australian Badminton Open Super Series title at the State Sports Centre in Sydney on 29 June, 2014. Saina began the match in aggressive fashion as she raced into a 12-8 lead in the first game against Spain's Carolina Marin in the final.